package com.wuxuehua.myapp.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Controller;

/**
 * Created with IntelliJ IDEA.
 * User: 吴学华
 * Date: 17-10-24
 * Time: 上午11:53
 */
@Controller
public class MyEventListener implements ApplicationListener<MyEvent>{
    @Override
    public void onApplicationEvent(MyEvent myEvent) {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(myEvent.getMessang());
    }
}
